#include <stdio.h>
#include <htc.h>
#include "picpredef.h"

void            hex2bcd(unsigned int hex, byte * p)
{
   byte            temp = hex / 100;
   byte	 		s ;
   

   s = (temp / 10) * 16 + (temp % 10);
   *p=s;
   temp = hex % 100;
   
   s = (temp / 10) * 16 + (temp % 10);
*(p + 1)=s;
}

void            hex2timedata(unsigned int hex, byte * p)
{
   byte            temp = hex / 60;

   *p = (temp / 10) * 16 + (temp % 10);
   temp = hex % 60;
   *(p + 1) = (temp / 10) * 16 + (temp % 10);

}
